<?php
    $meetings = $this->requestAction(array('controller' => 'committees', 'action' => 'ical'));
    $iCal->create($html->url('/'.$name,true), 'meetings', 'Asia/Kuala_Lumpur');
    foreach($meetings as $meeting)
    {
        $iCal->addEvent($meeting['Meeting']['meeting_date'], false, $meeting['Meeting']['meeting_title'].','.$meeting['Meeting']['meeting_num'], $html->url('/'.$meeting['Committee']['short_name'].'/meetings/view/'.$meeting['Meeting']['id'],true),array('UID'=>$html->url('/'.$meeting['Committee']['short_name'].'/meetings/view/'.$meeting['Meeting']['id'],true), 'attach'=>$html->url('/'.$meeting['Committee']['short_name'].'/meetings/view/'.$meeting['Meeting']['id'],true), 'location'=>$meeting['Meeting']['venue']));
    }
    //$this->calendar->saveCalendar(APP.'tmp',$name.ics',false);
    $iCal->render();
?> 
